import type { RouteRecordRaw } from "vue-router"

// interface Meta {
//     title: string, // 标题
//     icon?: string, // 图标
//     isHide?: boolean, // 代表路由在菜单中是否隐藏，是否隐藏[0隐藏，1显示]
//     isLink?: boolean, // 是否外链[有值则是外链]
//     isKeepAlive?: boolean, // 是否缓存路由数据[0是，1否]
// }

// 非单页面路由 不在菜单栏显示
export const routers: RouteRecordRaw[] = [
    {
        path: "/login",
        name: "login",
        meta: { title: "登录", isHide: true },
        component: () => import('@/views/login/login.vue')
    },
    {
        path: "/404",
        name: "404",
        meta: { title: "404", isHide: true },
        component: () => import('@/views/error/404.vue')
    },
    {
        path: "/test",
        name: "test",
        meta: { title: "test", isHide: true },
        component: () => import('@/views/error/test.vue')
    },
    {
        path: "/study/ts",
        name: "ts",
        meta: { title: "ts", isHide: true },
        component: () => import('@/views/study/ts.vue')
    },
]

//任意路由 无法匹配到的路由 重定向到404页面
export const anyRouter: RouteRecordRaw[] = [
    {
        path: "/:pathMatch(.*)*",
        name: 'Any',
        meta: { title: "404", isHide: true },
        redirect: "/404",
    },
]